package StudyCode.summary.mycollection;

import java.util.*;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class IterateOverUnmodifiableCollection {
	public static void main(String args[]) {
		List<String> list = new ArrayList<String>();

		list.add("This");
		list.add("is");
		list.add("Unmodifiable Collection");


		Collection<String> immutableCol = Collections.unmodifiableCollection(list);

		Iterator<String> iterator = immutableCol.iterator();

		while (iterator.hasNext()) {
			System.out.println(iterator.next());
		}
	}
}
